﻿using Microsoft.EntityFrameworkCore;
using SQLLiteServer.Tabels;
using System.Data.SQLite;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;

namespace SQLLiteServer
{
    public class MyDbContext : DbContext
    {
        string dbPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "chat.db");
        public MyDbContext()
        {

        }

        public MyDbContext(DbContextOptions<MyDbContext> options) : base(options)
        {
            
        }

        public DbSet<ChatRecord> ChatRecord { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlite($"Data Source={dbPath}");
        }
    }
}